package com.bdqn;

public class UserServiceImpl implements UserService {
    // 通过工厂获取所依赖的userdao对象
    private UserDao dao = UserDaoFactory.getInstance();
    private UserDao userDao;

    /**
     * 保存用户信息
     *
     * @param user
     */
    @Override
    public void save(User user) {
        // 调用UserDao的方法保存用户信息
        userDao.save(user);
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
}
